using System;
using System.Collections.Generic;
using System.Text;

using NBear.Common;
using NBear.IoC.Service;

namespace NBear.IoC.Service
{
    public delegate void ServiceRequestNotifyHandler(RequestMessage header);

    public interface IServiceMQ : ILogable
    {
        Guid SendRequestToQueue(string serviceName, RequestMessage msg);
        void SendResponseToQueue(ResponseMessage msg);
        RequestMessage ReceiveRequestFromQueue(Guid transactionId);
        ResponseMessage ReceieveResponseFromQueue(Guid transactionId);
        void SubscribeServiceRequest(string serviceName, Guid clientId, ServiceRequestNotifyHandler handler);
        void CleanExpiredMessages(out RequestMessage[] expiredRequests, out ResponseMessage[] expiredResponses);
        void SetBroadCastStrategy(IBroadCastStrategy broadCastStrategy);
    }
}
